'''
Created on 2010-6-25

@author: Zizon
'''
from HTMLParser import HTMLParser

class AuthorizePageProcessor(HTMLParser):
    #authenticity_token
    authenticity_token = ""
    
    def handle_starttag(self, tag, attrs):
        if tag == "input":
            attributes = dict(attrs)
            if attributes is not None and "name" in attributes.keys() and attributes["name"] == "authenticity_token" :
                self.authenticity_token = attributes["value"]